<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{$Think.config.WEB_SITE_TITLE} Power by 连云港信友科技有限公司 服务热线：400-000-9981</title>
<meta name="Keywords" content="连云港信友科技有限公司 服务热线：400-000-9981"/>
<meta name="Description" content="连云港信友科技有限公司 服务热线：400-000-9981"/> 
<!-- bootstrap - css -->
<link href="__PUBLIC__/BJUI/themes/css/bootstrap.min.css" rel="stylesheet">
<script src="__PUBLIC__/BJUI/js/jquery-1.7.2.min.js"></script>
<script src="__PUBLIC__/BJUI/js/jquery.PrintArea.js"></script>
</head>
<body>
<!-- core - css -->
<div class="container min_width1300"  id="printArea" style="text-align:center">
     <h3>{$Think.config.WEB_COMPANY_NAME}老板一张表</h3>
     <table border="1"  width="100%" style="font-size:14px;">
            <thead>
<tr>
<td>项目</th>
<td>本日{:date("Y-m-d",time())}</th>
<td>本月{:date("Y-m",time())}</th>
<td>本年{:date("Y",time())}</th>
<td>历史</th>
<td>{$_REQUEST['time1']}-{$_REQUEST['time2']}</th>
</tr>

            </thead>
<tbody>
<tr>
<td>潜在客户</td>
<td><php>echo M('cust')->where("addtime > '".date("Y-m-d",time())." 00:00:00' and addtime < '".date("Y-m-d",time())." 59:59:59'")->count('id');</php></td>
<td><php>echo M('cust')->where("addtime like '%".date("Y",time())."-%' and addtime like '%".date("m",time())."-%'")->count('id');</php></td>
<td><php>echo M('cust')->where("addtime like '%".date("Y",time())."-%' ")->count('id');</php></td>
<td><php>echo M('cust')->count('id');</php></td>
<td><php>echo M('cust')->where("addtime > '".$_REQUEST['time1']." 00:00:00' and addtime < '".$_REQUEST['time2']." 59:59:59'")->count('id');</php></td>
</tr>
<tr>
<td>客户联系人</td>
<td><php>echo M('custcon')->where("addtime > '".date("Y-m-d",time())." 00:00:00' and addtime < '".date("Y-m-d",time())." 59:59:59'")->count('id');</php></td>
<td><php>echo M('custcon')->where("addtime like '%".date("Y",time())."-%' and addtime like '%".date("m",time())."-%'")->count('id');</php></td>
<td><php>echo M('custcon')->where("addtime like '%".date("Y",time())."-%' ")->count('id');</php></td>
<td><php>echo M('custcon')->count('id');</php></td>
<td><php>echo M('custcon')->where("addtime > '".$_REQUEST['time1']." 00:00:00' and addtime < '".$_REQUEST['time2']." 59:59:59'")->count('id');</php></td>
</tr>
<tr>
<td>跟单记录</td>
<td><php>echo M('custgd')->where("addtime > '".date("Y-m-d",time())." 00:00:00' and addtime < '".date("Y-m-d",time())." 59:59:59'")->count('id');</php></td>
<td><php>echo M('custgd')->where("addtime like '%".date("Y",time())."-%' and addtime like '%".date("m",time())."-%'")->count('id');</php></td>
<td><php>echo M('custgd')->where("addtime like '%".date("Y",time())."-%' ")->count('id');</php></td>
<td><php>echo M('custgd')->count('id');</php></td>
<td><php>echo M('custgd')->where("addtime > '".$_REQUEST['time1']." 00:00:00' and addtime < '".$_REQUEST['time2']." 59:59:59'")->count('id');</php></td>
</tr>
<tr>
<td>入库记录</td>
<td><php>echo M('ruku')->where("addtime > '".date("Y-m-d",time())." 00:00:00' and addtime < '".date("Y-m-d",time())." 59:59:59'")->sum('shuliang');</php></td>
<td><php>echo M('ruku')->where("addtime like '%".date("Y",time())."-%' and addtime like '%".date("m",time())."-%'")->sum('shuliang');</php></td>
<td><php>echo M('ruku')->where("addtime like '%".date("Y",time())."-%' ")->sum('shuliang');</php></td>
<td><php>echo M('ruku')->sum('shuliang');</php></td>
<td><php>echo M('ruku')->where("addtime > '".$_REQUEST['time1']." 00:00:00' and addtime < '".$_REQUEST['time2']." 59:59:59'")->sum('shuliang');</php></td>
</tr>
<tr>
<td>出库记录</td>
<td><php>echo M('chuku')->where("addtime > '".date("Y-m-d",time())." 00:00:00' and addtime < '".date("Y-m-d",time())." 59:59:59'")->sum('shuliang');</php></td>
<td><php>echo M('chuku')->where("addtime like '%".date("Y",time())."-%' and addtime like '%".date("m",time())."-%'")->sum('shuliang');</php></td>
<td><php>echo M('chuku')->where("addtime like '%".date("Y",time())."-%' ")->sum('shuliang');</php></td>
<td><php>echo M('chuku')->sum('shuliang');</php></td>
<td><php>echo M('chuku')->where("addtime > '".$_REQUEST['time1']." 00:00:00' and addtime < '".$_REQUEST['time2']." 59:59:59'")->sum('shuliang');</php></td>
</tr>
<tr>
<td>新增合同</td>
<td><php>echo M('hetong')->where("addtime > '".date("Y-m-d",time())." 00:00:00' and addtime < '".date("Y-m-d",time())." 59:59:59'")->count('id');</php></td>
<td><php>echo M('hetong')->where("addtime like '%".date("Y",time())."-%' and addtime like '%".date("m",time())."-%'")->count('id');</php></td>
<td><php>echo M('hetong')->where("addtime like '%".date("Y",time())."-%' ")->count('id');</php></td>
<td><php>echo M('hetong')->count('id');</php></td>
<td><php>echo M('hetong')->where("addtime > '".$_REQUEST['time1']." 00:00:00' and addtime < '".$_REQUEST['time2']." 59:59:59'")->count('id');</php></td>
</tr>
<tr>
<td>收款记录</td>
<td><php>echo M('shou')->where("addtime > '".date("Y-m-d",time())." 00:00:00' and addtime < '".date("Y-m-d",time())." 59:59:59'")->sum('jine');</php></td>
<td><php>echo M('shou')->where("addtime like '%".date("Y",time())."-%' and addtime like '%".date("m",time())."-%'")->sum('jine');</php></td>
<td><php>echo M('shou')->where("addtime like '%".date("Y",time())."-%' ")->sum('jine');</php></td>
<td><php>echo M('shou')->sum('jine');</php></td>
<td><php>echo M('shou')->where("addtime > '".$_REQUEST['time1']." 00:00:00' and addtime < '".$_REQUEST['time2']." 59:59:59'")->sum('jine');</php></td>
</tr>
<tr>
<td>付款记录</td>
<td><php>echo M('fukuan')->where("addtime > '".date("Y-m-d",time())." 00:00:00' and addtime < '".date("Y-m-d",time())." 59:59:59'")->sum('jine');</php></td>
<td><php>echo M('fukuan')->where("addtime like '%".date("Y",time())."-%' and addtime like '%".date("m",time())."-%'")->sum('jine');</php></td>
<td><php>echo M('fukuan')->where("addtime like '%".date("Y",time())."-%' ")->sum('jine');</php></td>
<td><php>echo M('fukuan')->sum('jine');</php></td>
<td><php>echo M('fukuan')->where("addtime > '".$_REQUEST['time1']." 00:00:00' and addtime < '".$_REQUEST['time2']." 59:59:59'")->sum('jine');</php></td>
</tr>
            </tbody>
        </table>
</div>
<div style="text-align:center;margin-top:50px;">
		<button type="button" id="print_btn" class="btn btn-primary">打印</button>&nbsp;
		<button type="button" onclick="javascript:window.close();" class="btn">关闭</button>
	   </div>
<script type="text/javascript">
/**
 * 打印
 **/
$('#print_btn').click(function(){
	$('#printArea').printArea();
	$(this).html('加载中 ...');
	setTimeout("$('#print_btn').html('打印');",1200);
});
</script>
 </body>
</html>